package org.sfs.storemypassword.view.domain;

import org.romaframework.aspect.view.ViewCallback;
import org.romaframework.aspect.view.ViewConstants;
import org.romaframework.aspect.view.annotation.ViewClass;
import org.romaframework.aspect.view.annotation.ViewField;
import org.romaframework.core.Roma;
import org.romaframework.frontend.domain.page.HomePageBasic;
import org.romaframework.module.users.domain.BaseAccount;
import org.sfs.storemypassword.view.domain.register.BaseAccountWrapper;

@ViewClass(layout = "screen://body")
public class HomePageRegister extends HomePageBasic implements ViewCallback {

	private BaseAccountWrapper	account;

	public HomePageRegister() {
	}

	@ViewField(render = ViewConstants.RENDER_URL, label = "", layout = "screen://header")
	public String getHeader() {
		return "${application}${session}/dynamic/common/headerRegister.jsp";
	}

	public BaseAccountWrapper getAccount() {
		return account;
	}

	public void setAccount(BaseAccountWrapper wrapper) {
		this.account = wrapper;
	}

	public void save() {
		account.save();
	}

	public void onShow() {
		account = new BaseAccountWrapper(new BaseAccount());
		Roma.fieldChanged(this, "account");
	}

}
